package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * @author lifeStyle on 2020/4/14 0014.
 */
public class MyCardModel {
    public Observable<ResponseBody> getInfo(Context context, String page,String state) {
        Map<String, String> maps = new HashMap<>();
        maps.put("pageNo", page);
        maps.put("pageSize", Constants.PageSize);
        maps.put("state", state);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10048, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
    public Observable<ResponseBody> getCanclKeep(Context context, String type,String state) {
        Map<String, String> maps = new HashMap<>();
        maps.put("type", type);
        maps.put("cid", state);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10162, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
    public Observable<ResponseBody> getShop(Context context, String page) {
        Map<String, String> maps = new HashMap<>();
        maps.put("pageNo", page);
        maps.put("pageSize", Constants.PageSize);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10043, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
    public Observable<ResponseBody> getBook(Context context, String page) {
        Map<String, String> maps = new HashMap<>();
        maps.put("pageNo", page);
        maps.put("pageSize", Constants.PageSize);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10044, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
    public Observable<ResponseBody> getExchangeInfo(Context context, String dhcode) {
        Map<String, String> maps = new HashMap<>();
        maps.put("dhcode", dhcode);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10049, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
}
